<template>
    <div class="Selectreview">
        <mt-header fixed title="请选择身份证行驶证审核">
            <mt-button icon="back" @click="backprev" slot="left"></mt-button>
        </mt-header>
        <mt-tab-container style="margin-top: 40px;" >
            <mt-tab-container-item>
                <mt-cell  title="身份证审核"  :label="'共：'+authIdCardCount+'条'">
                    <router-link  :to="{ path: '/reviewlist', query: { isIdCard : true}}">
                        <mt-button type="primary"  size="small">身份证审核</mt-button>
                    </router-link>
                </mt-cell>
                <mt-cell  title="行驶证审核"  :label="'共：'+authCarCount+'条'">
                    <router-link :to="{ path: '/reviewlist', query: { isIdCard : false }}">
                        <mt-button  type="danger"  size="small" style="margin-left: 10px;">行驶证审核</mt-button>
                    </router-link>
                </mt-cell>

            </mt-tab-container-item>
        </mt-tab-container>
    </div>
</template>

<script>
    import {
            login,
            back,
            authcount,
            loading
    } from '../common/api/api';
    export default {
        name: 'Selectreview',
        data () {
            return {
                createDialog: {
                    opened: false,
                    loading: false
                },
                authCarCount : null,
                authIdCardCount : null,
            }
        },
        components: {
            //Hello
        },
        methods: {
            backprev : function () {
                this.$router.push('/home');
            },
            init : function () {
                var vm = this;
                loading(true);
                authcount({}, {
                    target: vm.createDialog
                })
                        .then((data) => {
                            console.log(data);
                            vm.createDialog.opened = false;
                            if(data.errno == 0){
                                loading(false);
                                vm.authIdCardCount = data.data.authIdCardCount;
                                vm.authCarCount = data.data.authCarCount;
                            }else{
                                loading(false);
                                Toast(data.errmsg);
                            }

                        });
            }
        },
        created() {
          this.init()
        }
    }
</script>
